//
//  DQBBaseViewController.m
//  DrivingQuestionBank
//
//  Created by mac on 2023/12/28.
//

#import "DQBBaseViewController.h"

@interface DQBBaseViewController ()

@end

@implementation DQBBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self creatNavigationBarView];
    
}

- (void)creatNavigationBarView{
    if (self.navigationController.viewControllers.count > 1) {
        UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageWithOriginal:@"back"] style:UIBarButtonItemStyleDone target:self action:@selector(backLast)];
        self.navigationItem.leftBarButtonItem = backItem;
    }
    
    if (@available(iOS 13.0, *)) {
        UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
        [appearance configureWithOpaqueBackground];
        appearance.backgroundColor = DQBRGBHex(0xFFCF2D);
        
        self.navigationController.navigationBar.standardAppearance = appearance;
        self.navigationController.navigationBar.scrollEdgeAppearance = appearance;
    } else {
        // Fallback on earlier versions
    }
    
    self.navigationController.navigationBar.barTintColor = DQBRGBHex(0xFFCF2D);
    self.navigationController.navigationBar.backgroundColor = DQBRGBHex(0xFFCF2D);
}


- (void)backLast{
    [self.navigationController popViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
